<?php 
session_start();

error_reporting(E_ALL);
ini_set("display_errors", 1);

require_once '../../sys/config.php';
require_once PATH_PROVIDER."netfonds.php";
require_once PATH_DB_MAIN."TB_stockData.php";


$servProv = new $_POST["provider"]();
$stockName = $_POST["stockName"];
$timestamp = strtotime(str_replace('/', '-', $_POST["timestamp"]));

$tbl = new TBL_StockData($stockName, $servProv->GetStockDataType(), $servProv->HasTickData());

$fileLineCnt = $servProv->BeginStockRead($stockName, $timestamp, $tbl->LastData());

$_SESSION["enc_servProv"] = serialize($servProv);
$_SESSION["enc_fileLineCnt"] = serialize($fileLineCnt);
$_SESSION["enc_stockName"] = serialize($stockName);

header("Location: import.php");

?>
